#pragma once
#include "dx_common.h"

namespace d3d12
{
	struct FrameBuffer
	{
		ID3D12Resource* rt;
		descriptor_handle rt_handle;
		ID3D12Resource* ds;
		descriptor_handle ds_handle;
	};

	class Command;

	struct Surface
	{
		IDXGISwapChainN* swapchain;
		FrameBuffer frames[COMMAND_FRAME_COUNT];
		u32 current_index;
		RECT rectangle;
		u32 flag{};
		u32 sync_interval{};
		DXGI_PRESENT_PARAMETERS parameters{};
		D3D12_VIEWPORT viewport{};
		D3D12_RECT scissor_rect{};

#ifdef _DEBUG
		Command* createor;
#endif // _DEBUG
	};

	bool initialize();
	void shutdown();
	const wchar_t* get_level_name();
	ID3D12DeviceN* device();
	ID3D12DescriptorHeap* get_desc_heap(D3D12_DESCRIPTOR_HEAP_TYPE);
	descriptor_handle allocator_handle(D3D12_DESCRIPTOR_HEAP_TYPE);
	ID3D12CommandQueue* get_direct_queue();
	ID3D12CommandQueue* get_copy_queue();
}